<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="客户下单帐号" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<link href="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.css" rel="stylesheet" type="text/css">
<script src="/js/QueryList.js"></script>
<script src="/js/popup_ext.js"></script>
<script src="/calendar/dhtmlgoodies_calendar/dhtmlgoodies_calendar.js"></script>
<script language="javascript">
	function changeEnabled(){
		if(document.getElementsByName("enabledRadio")[0].checked){
			document.getElementById("user.enabled").value="Y";
		}else{
			document.getElementById("user.enabled").value="N";
		}
	}
	function changePt(){
		if(document.getElementsByName("ptRadio")[0].checked){
			document.getElementById("user.pricType").value="STAN";
		}else{
			document.getElementById("user.pricType").value="CLIE";
		}
	}
	function changeOt(){
		if(document.getElementsByName("otRadio")[0].checked){
			document.getElementById("user.ordeType").value="UP_ZERO";
		}else{
			document.getElementById("user.ordeType").value="LOW_ZERO";
		}
	}
	function selectClie(){
		var url="/base/EstablishmentListForSelect.ihtm?type=CLIENT";
		ShowIframe("选择客户",url,900,500,"selectClieCallBack()",400,320);
	}
	function selectClieCallBack(){
		if(popRetVal!=null){
			document.getElementById("user.clieId").value=popRetVal[0];
			document.getElementById("clieName").value=popRetVal[1];
		}
	}
	function doSave(flag){
		document.getElementById("buttonDiv").style.display="none";
		document.getElementById("waitDiv").style.display="";
		document.getElementById("continue_flag").value=flag;
		frm.submit();
	}
	function doCancel(){
		parent.ClosePop();
	}
	function showMe(){
		showFormErrorMsg();
		document.getElementById("user.userName").focus();
	}
</script>
</head>
<body oncontextmenu="return false" scroll="no" onLoad="showMe();" class="sheet modal-dialog" style="padding-top:10px;">
<div class="sheet-main" id="bodyDiv" style="width:370px;">
	<form name="frm" method="post">
	  <div class="sheet-list" style="width:100%">
	    <div class="modal-main search-business">
	    	<div style="width:100%;">
				<c:if test="${id==null || id==''}"><c:set var="pageTopTitle" value="新增客户下单帐号" /></c:if>
				<c:if test="${id!=null && id!=''}"><c:set var="pageTopTitle" value="编辑客户下单帐号" /></c:if>
				<%@ include file="../inc/PageTop.jsp"%> 
				<table border="0" cellspacing="1" cellpadding="1" align="center" class="table-a">
					<tr>
				      	<th><span class="MustInput">*</span>登录帐号：</th>
				      	<spring:bind path="command.user.userName">
				      	<td>
				      		<input type="text"  class="TextBox" maxlength="15" onKeyUp="goNextInput('currentPassword');" id="${status.expression}" name="${status.expression}" value="${status.value}">
					          <script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',1,'user.userName');
					          </script>
				     	</td>
				     	</spring:bind>
					</tr>
					<tr>
				      	<th><span class="MustInput">*</span>密码：</th>
				      	<spring:bind path="command.currentPassword">
				      	<td>
				      		<input type="text" class="TextBox" maxlength="15" id="${status.expression}" name="${status.expression}" value="${status.value}">
				      		<c:if test="${id!=null && id!=''}"><br><span style="color:#aaa">不输保留原有密码</span></c:if>
					        <script language="javascript">
					          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',2,'currentPassword');
					        </script>
				     	</td>
				     	</spring:bind>
					</tr>
					<tr>
				      	<th><span class="MustInput">*</span>客户：</th>
				      	<td>
				      		<spring:bind path="command.clieName">
				      		<input type="text" class="TextBox readonly" readOnly="true" id="${status.expression}" name="${status.expression}" value="${status.value}">
							<img class="make-a" src="/images/make-a.gif" style="cursor:pointer;"  onClick="selectClie();"/>
				      		</spring:bind>
				      		<spring:bind path="command.user.clieId">
						        <script language="javascript">
						          	setFormErrorMsg('<c:out value="${status.errorMessage}" />',3);
						        </script>
								<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
							</spring:bind>
				     	</td>
					</tr>
					<tr>
				      	<th>价格类型：</th>
				      	<td>
				      		<input type="radio" name="ptRadio" onClick="changePt();" <c:if test="${command.user.pricType=='STAN'}">checked</c:if>>标准价 <input type="radio" name="ptRadio" onClick="changePt();" <c:if test="${command.user.pricType=='CLIE'}">checked</c:if>>客户价
							<spring:bind path="command.user.pricType">
							<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
							</spring:bind>
				     	</td>
					</tr>
					<tr>
				      	<th>下单类型：</th>
				      	<td>
				      		<input type="radio" name="otRadio" onClick="changeOt();" <c:if test="${command.user.ordeType=='UP_ZERO'}">checked</c:if>>余额不足不能下单 <input type="radio" name="otRadio" onClick="changeOt();" <c:if test="${command.user.ordeType=='LOW_ZERO'}">checked</c:if>>余额不足可以下单
							<spring:bind path="command.user.ordeType">
							<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
							</spring:bind>
				     	</td>
					</tr>
					<tr>
				      	<th>状态：</th>
				      	<td>
				      		<input type="radio" name="enabledRadio" onClick="changeEnabled();" <c:if test="${command.user.enabled=='Y'}">checked</c:if>>正常 <input type="radio" name="enabledRadio" onClick="changeEnabled();" <c:if test="${command.user.enabled=='N'}">checked</c:if>>停用
							<spring:bind path="command.user.enabled">
							<input type="hidden" id="${status.expression}" name="${status.expression}" value="${status.value}">
							</spring:bind>
				     	</td>
					</tr>
				</table>
			</div>
	  	</div>
	  </div>
		<div class="modal-buttom" id="buttonDiv">
			<input type="button" class="buttom-a" value=" 保 存 " onClick="doSave('0');">
			<input type="button" class="buttom-a" value="保存并新增" onClick="doSave('1');">
			<input type="button" class="buttom-a" value=" 取 消 " onClick="doCancel();">
			<input type="hidden" name="continue_flag" id="continue_flag" value="0">			
		</div>
		<div class="modal-buttom" id="waitDiv" style="display:none">
			<span style="color:#ffffff">请稍候...</span>
		</div>
	</form>
</div>
</body>
</html>